package com.qi.spzx.manager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qi.spzx.model.entity.product.Brand;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description TODO
 * @Author dingchunlin
 * @Date 2024/2/23 15:03
 * @Version 1.0.0
 */
@Mapper
public interface BrandMapper{

    @Select("select * from brand where is_deleted = 1 order by id desc")
    List<Brand> selectAll();

    @Insert("insert into brand value(null,#{name},#{logo},now(),now(),1)")
    void save(Brand brand);

    @Update("update brand set is_deleted = 0 , update_time = now() where id = #{id}")
    void deleteById(Long id);

    void updateById(Brand brand);

    @Select("select * from brand where id = #{id} and is_deleted = 1 ")
    Brand selectById(Long id);
}
